<!--
  
   GameContextMenu.xaml
  
   Copyright (c) 2007 Mike Strobel
  
   This source code is subject to the terms of the Microsoft Reciprocal License (Ms-RL).
   For details, see <http://www.opensource.org/licenses/ms-rl.html>.
  
   All other rights reserved.
  
  -->
<ResourceDictionary xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:Supremacy.Client"
                    xmlns:scc="http://schemas.startreksupremacy.com/xaml/presentation">


  <!-- MOUSE OVER SOUND STYLE -->
  <Style x:Key="MouseOverSoundStyle"
         TargetType="{x:Type MenuItem}">
    <Style.Triggers>
      <!--<EventTrigger RoutedEvent="MenuItem.Click">
        <EventTrigger.Actions>
          <SoundPlayerAction Source="vfs:///Resources/UI/Federation/Sounds/GameContextMenuItem.wav" />
        </EventTrigger.Actions>
      </EventTrigger>-->
    </Style.Triggers>
  </Style>


  <!-- 
    ***************************
    * GAME CONTEXT MENU STYLE *
    ***************************
  -->
  <Style TargetType="{x:Type local:GameContextMenu}">
        <Style.Resources>
            <BitmapImage x:Key="Image_Main1"
                             CacheOption="OnLoad"
                             UriSource="vfs:///Resources/UI/Federation/ContextMenu/main1.png" />
            <BitmapImage x:Key="Image_Main2"
                             CacheOption="OnLoad"
                             UriSource="vfs:///Resources/UI/Federation/ContextMenu/main2.png" />
            <BitmapImage x:Key="Image_Dip1"
                             CacheOption="OnLoad"
                             UriSource="vfs:///Resources/UI/Federation/ContextMenu/embassy1.png" />
            <BitmapImage x:Key="Image_Dip2"
                             CacheOption="OnLoad"
                             UriSource="vfs:///Resources/UI/Federation/ContextMenu/embassy2.png" />
            <BitmapImage x:Key="Image_Intel1"
                             CacheOption="OnLoad"
                             UriSource="vfs:///Resources/UI/Federation/ContextMenu/intel1.png" />
            <BitmapImage x:Key="Image_Intel2"
                             CacheOption="OnLoad"
                             UriSource="vfs:///Resources/UI/Federation/ContextMenu/intel2.png" />
            <BitmapImage x:Key="Image_Menu1"
                             CacheOption="OnLoad"
                             UriSource="vfs:///Resources/UI/Federation/ContextMenu/menu1.png" />
            <BitmapImage x:Key="Image_Menu2"
                             CacheOption="OnLoad"
                             UriSource="vfs:///Resources/UI/Federation/ContextMenu/menu2.png" />
            <BitmapImage x:Key="Image_Science1"
                             CacheOption="OnLoad"
                             UriSource="vfs:///Resources/UI/Federation/ContextMenu/science1.png" />
            <BitmapImage x:Key="Image_Science2"
                             CacheOption="OnLoad"
                             UriSource="vfs:///Resources/UI/Federation/ContextMenu/science2.png" />
            <BitmapImage x:Key="Image_Systems1"
                             CacheOption="OnLoad"
                             UriSource="vfs:///Resources/UI/Federation/ContextMenu/system1.png" />
            <BitmapImage x:Key="Image_Systems2"
                             CacheOption="OnLoad"
                             UriSource="vfs:///Resources/UI/Federation/ContextMenu/system2.png" />
        </Style.Resources>
            <Setter Property="LayoutTransform"
            Value="{Binding Path=MainWindow.LayoutTransform, Source={x:Static Application.Current}}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:GameContextMenu}">
          <Border Background="{TemplateBinding Background}"
                  BorderBrush="{TemplateBinding BorderBrush}"
                  BorderThickness="{TemplateBinding BorderThickness}">
            <Canvas Width="280"
                    Height="245">
              <Image>
                <Image.Source>
                  <BitmapImage CacheOption="OnLoad"
                               UriSource="vfs:///Resources/UI/Federation/ContextMenu/popup.png" />
                </Image.Source>
              </Image>
              <MenuItem x:Name="MenuItem_Main"
                        Canvas.Left="16"
                        Canvas.Top="23"
                        Command="{x:Static scc:NavigationCommands.ActivateScreen}"
                        CommandParameter="{x:Static scc:StandardGameScreens.GalaxyScreen}"
                        Style="{StaticResource MouseOverSoundStyle}">
                <MenuItem.Template>
                  <ControlTemplate TargetType="{x:Type MenuItem}">
                    <Image x:Name="MenuItemContent_Main"
                           Source="{StaticResource Image_Main1}" />
                    <ControlTemplate.Triggers>
                      <Trigger Property="IsMouseOver"
                               Value="True">
                        <Setter TargetName="MenuItemContent_Main"
                                Property="Source"
                                Value="{StaticResource Image_Main2}" />
                      </Trigger>
                      <Trigger Property="IsPressed"
                               Value="True">
                        <Setter TargetName="MenuItemContent_Main"
                                Property="Source"
                                Value="{StaticResource Image_Main1}" />
                      </Trigger>
                    </ControlTemplate.Triggers>
                  </ControlTemplate>
                </MenuItem.Template>
              </MenuItem>
              <MenuItem x:Name="MenuItem_Systems"
                        Canvas.Left="100"
                        Canvas.Top="23"
                        Command="{x:Static scc:NavigationCommands.ActivateScreen}"
                        CommandParameter="{x:Static scc:StandardGameScreens.ColonyScreen}"
                        Style="{StaticResource MouseOverSoundStyle}">
                <MenuItem.Template>
                  <ControlTemplate TargetType="{x:Type MenuItem}">
                    <Image x:Name="MenuItemContent_Systems"
                           Source="{StaticResource Image_Systems1}" />
                    <ControlTemplate.Triggers>
                      <Trigger Property="IsMouseOver"
                               Value="True">
                        <Setter TargetName="MenuItemContent_Systems"
                                Property="Source"
                                Value="{StaticResource Image_Systems2}" />
                      </Trigger>
                      <Trigger Property="IsPressed"
                               Value="True">
                        <Setter TargetName="MenuItemContent_Systems"
                                Property="Source"
                                Value="{StaticResource Image_Systems1}" />
                      </Trigger>
                    </ControlTemplate.Triggers>
                  </ControlTemplate>
                </MenuItem.Template>
              </MenuItem>
              <MenuItem x:Name="MenuItem_Dip"
                        Canvas.Left="184"
                        Canvas.Top="23"
                        Command="{x:Static scc:NavigationCommands.ActivateScreen}"
                        CommandParameter="{x:Static scc:StandardGameScreens.DiplomacyScreen}"
                        Style="{StaticResource MouseOverSoundStyle}">
                <MenuItem.Template>
                  <ControlTemplate TargetType="{x:Type MenuItem}">
                    <Image x:Name="MenuItemContent_Dip"
                           Source="{StaticResource Image_Dip1}" />
                    <ControlTemplate.Triggers>
                      <Trigger Property="IsMouseOver"
                               Value="True">
                        <Setter TargetName="MenuItemContent_Dip"
                                Property="Source"
                                Value="{StaticResource Image_Dip2}" />
                      </Trigger>
                      <Trigger Property="IsPressed"
                               Value="True">
                        <Setter TargetName="MenuItemContent_Dip"
                                Property="Source"
                                Value="{StaticResource Image_Dip1}" />
                      </Trigger>
                    </ControlTemplate.Triggers>
                  </ControlTemplate>
                </MenuItem.Template>
              </MenuItem>
              <MenuItem x:Name="MenuItem_Science"
                        Canvas.Left="16"
                        Canvas.Top="124"
                        Command="{x:Static scc:NavigationCommands.ActivateScreen}"
                        CommandParameter="{x:Static scc:StandardGameScreens.ScienceScreen}"
                        Style="{StaticResource MouseOverSoundStyle}">
                <MenuItem.Template>
                  <ControlTemplate TargetType="{x:Type MenuItem}">
                    <Image x:Name="MenuItemContent_Science"
                           Source="{StaticResource Image_Science1}" />
                    <ControlTemplate.Triggers>
                      <Trigger Property="IsMouseOver"
                               Value="True">
                        <Setter TargetName="MenuItemContent_Science"
                                Property="Source"
                                Value="{StaticResource Image_Science2}" />
                      </Trigger>
                      <Trigger Property="IsPressed"
                               Value="True">
                        <Setter TargetName="MenuItemContent_Science"
                                Property="Source"
                                Value="{StaticResource Image_Science1}" />
                      </Trigger>
                    </ControlTemplate.Triggers>
                  </ControlTemplate>
                </MenuItem.Template>
              </MenuItem>
              <MenuItem x:Name="MenuItem_Intel"
                        Canvas.Left="100"
                        Canvas.Top="124"
                        Command="{x:Static scc:NavigationCommands.ActivateScreen}"
                        CommandParameter="{x:Static scc:StandardGameScreens.PersonnelScreen}"
                        Style="{StaticResource MouseOverSoundStyle}">
                <MenuItem.Template>
                  <ControlTemplate TargetType="{x:Type MenuItem}">
                    <Image x:Name="MenuItemContent_Intel"
                           Source="{StaticResource Image_Intel1}" />
                    <ControlTemplate.Triggers>
                      <Trigger Property="IsMouseOver"
                               Value="True">
                        <Setter TargetName="MenuItemContent_Intel"
                                Property="Source"
                                Value="{StaticResource Image_Intel2}" />
                      </Trigger>
                      <Trigger Property="IsPressed"
                               Value="True">
                        <Setter TargetName="MenuItemContent_Intel"
                                Property="Source"
                                Value="{StaticResource Image_Intel1}" />
                      </Trigger>
                    </ControlTemplate.Triggers>
                  </ControlTemplate>
                </MenuItem.Template>
              </MenuItem>
              <MenuItem x:Name="MenuItem_Menu"
                        Canvas.Left="184"
                        Canvas.Top="124"
                        Command="{x:Static scc:NavigationCommands.ActivateScreen}"
                        CommandParameter="{x:Static scc:StandardGameScreens.MenuScreen}"
                        Style="{StaticResource MouseOverSoundStyle}">
                <MenuItem.Template>
                  <ControlTemplate TargetType="{x:Type MenuItem}">
                    <Image x:Name="MenuItemContent_Menu"
                           Source="{StaticResource Image_Menu1}" />
                    <ControlTemplate.Triggers>
                      <Trigger Property="IsMouseOver"
                               Value="True">
                        <Setter TargetName="MenuItemContent_Menu"
                                Property="Source"
                                Value="{StaticResource Image_Menu2}" />
                      </Trigger>
                      <Trigger Property="IsPressed"
                               Value="True">
                        <Setter TargetName="MenuItemContent_Menu"
                                Property="Source"
                                Value="{StaticResource Image_Menu1}" />
                      </Trigger>
                    </ControlTemplate.Triggers>
                  </ControlTemplate>
                </MenuItem.Template>
              </MenuItem>
            </Canvas>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <EventTrigger RoutedEvent="ContextMenu.Opened">
        <EventTrigger.Actions>
          <SoundPlayerAction Source="Resources/UI/Federation/Sounds/GameContextMenu.wav" />
        </EventTrigger.Actions>
      </EventTrigger>
    </Style.Triggers>
  </Style>

</ResourceDictionary>